<?php

namespace app\api\model;

use think\Model;

/**
 * Land
 */
class Land extends Model
{
    // 表名
    protected $name = 'land';

    // 自动写入时间戳字段
    protected $autoWriteTimestamp = true;

    public function getLandList(){
        $list = self::where(['status' => 1])->field('id,name,image,area,total_nums,residue_nums,notice,content')
            ->order('weigh desc')
            ->paginate(10);
        foreach ($list as &$land){
            $land['image'] =env('domain.image_url').$land['image'];
        }
        return api_message($list);
    }
}